package cheme.Interpreter.AST.Equation;

import cheme.Interpreter.AST.Interfaces.IAstEquation;
import cheme.Interpreter.AST.Interfaces.IAstExpression;

/*
 * Represents an equation in a system of equations.
 * In any given equation, only on reference to a varaible of Unkown status is 
 * allowed.  
 */

public class AstEquation implements IAstEquation
{
	IAstExpression lhs;
	IAstExpression rhs;
	
	public AstEquation()
	{
	}
	
	public AstEquation(IAstExpression lhs, IAstExpression rhs)
	{
		super();
		this.lhs = lhs;
		this.rhs = rhs;
	}
	
	public IAstExpression getLhs()
	{
		return lhs;
	}

	public void setLhs(IAstExpression lhs)
	{
		this.lhs = lhs;
	}

	public IAstExpression getRhs()
	{
		return rhs;
	}

	public void setRhs(IAstExpression rhs)
	{
		this.rhs = rhs;
	}

	@Override
	public String toString()
	{
		if(null != getLhs() && null != getRhs())
		{
			return "{" + getLhs().toString() + " == " + getRhs().toString() + "}";
		}

		return "";
	}
}
